<template>
<el-dialog
    v-model="dialogVisible"
    title="任务通知书"
    width="30%"
    :before-close="handleClose"
  >
    <public-table :table-data="list" :table-option="tableOption">
      <template #fileAddress="{scope}">
        <el-link :href="scope.row.fileAddress" target="_blank" type="primary">下载</el-link>
      </template>
    </public-table>
  </el-dialog>
</template>

<script setup>
import {ref} from "vue";
import PublicTable from "@/components/PublicTable.vue";

const props = defineProps({
  list: {
    type: Array,
    default: () => [],
  },
});

const dialogVisible = ref(false);
const tableOption = ref([
    { label: "文件名称", prop: "fileName", minWidth: 100 },
    { label: "文件地址", prop: "fileAddress", minWidth: 100,slot:true },
]);

/**
 * 关闭弹窗
 */
const handleClose = () => {
  dialogVisible.value = false;
};

/**
 * 打开弹窗
 */
const handleOpen = () => {
  dialogVisible.value = true;
};

/**
 * 暴露给父组件的方法
 */
defineExpose({
  handleClose,
  handleOpen,
});
</script>

<style scoped>

</style>
